package com.xjtu.platform.admin.user.dao;

import com.xjtu.platform.admin.user.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserDao {
    @Select("select user_id,user_name,role_id from user")
    List<User> findUser(UserDto userDto);

    @Insert("insert into user values(#{user_id},#{role_id},0,#{user_name},'',#{user_pwd},'',0,'','',0,'')")
    void addUser(NewUserDto newUserDto);

    @Delete("delete from user where user_id=#{user_id}")
    void deleteUser(DeletedUserDto deletedUserDto);

    @Update("update user set role_id=#{role_id} where user_id=#{user_id}")
    void changeRole(ChangeRoleDto changeRoleDto);
}
